<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div id="i1" style="display: inline-block;background-color: red;color: white">
        欢迎光临
    </div>
    <script>
        //每秒执行一次动作
        setInterval('f1()',1000)

        function f1() {
            //JS获取标签
            var tag = document.getElementById('i1');
            //获取标签内容
            var text=tag.innerText;
            //拼接
            var a =text.charAt(text.length-1);
            var b =text.substring(0,text.length-1);
            var new_text = a+b;

            //把新的内容还给div标签
            tag.innerText = new_text;
        }
    </script>
</body>
</html>